home *** CD-ROM | disk | FTP | other *** search
/ BCI NET 2 / BCI NET 2.iso / archives / programming / c / gcc263-utildoc.lha / gnu / man / man1 / test.1 < prev    next >
Encoding:
Text File  |  1994-12-19  |  4.8 KB  |  133 lines

  1.  
  2.  
  3.  
  4. TEST(1L)                                                 TEST(1L)
  5.  
  6.  
  7. NNAAMMEE
  8.        test - check file types and compare values
  9.  
  10. SSYYNNOOPPSSIISS
  11.        tteesstt [expr]
  12.        tteesstt {--help,--version}
  13.  
  14. DDEESSCCRRIIPPTTIIOONN
  15.        This  manual page documents the GNU version of tteesstt.  Note
  16.        that most shells have a built-in command by the same  name
  17.        and with similar functionality.
  18.  
  19.        tteesstt  returns  a status of 0 (true) or 1 (false) depending
  20.        on the evaluation  of  the  conditional  expression  _e_x_p_r.
  21.        Expressions may be unary or binary.  Unary expressions are
  22.        often used to examine the status of  a  file.   There  are
  23.        string operators and numeric comparison operators as well.
  24.  
  25.        --bb _f_i_l_e
  26.               True if _f_i_l_e exists and is block special.
  27.        --cc _f_i_l_e
  28.               True if _f_i_l_e exists and is character special.
  29.        --dd _f_i_l_e
  30.               True if _f_i_l_e exists and is a directory.
  31.        --ee _f_i_l_e
  32.               True if _f_i_l_e exists
  33.        --ff _f_i_l_e
  34.               True if _f_i_l_e exists and is a regular file.
  35.        --gg _f_i_l_e
  36.               True if _f_i_l_e exists and is set-group-id.
  37.        --kk _f_i_l_e
  38.               True if _f_i_l_e has its ``sticky'' bit set.
  39.        --LL _f_i_l_e
  40.               True if _f_i_l_e exists and is a symbolic link.
  41.        --pp _f_i_l_e
  42.               True if _f_i_l_e exists and is a named pipe.
  43.        --rr _f_i_l_e
  44.               True if _f_i_l_e exists and is readable.
  45.        --ss _f_i_l_e
  46.               True if _f_i_l_e exists and has  a  size  greater  than
  47.               zero.
  48.        --SS _f_i_l_e
  49.               True if _f_i_l_e exists and is a socket.
  50.        --tt [[_f_d]]
  51.               True if _f_d is opened on a terminal.  If _f_d is omit-
  52.               ted, it defaults to 1 (standard output).
  53.        --uu _f_i_l_e
  54.               True if _f_i_l_e exists and its set-user-id bit is set.
  55.        --ww _f_i_l_e
  56.               True if _f_i_l_e exists and is writable.
  57.        --xx _f_i_l_e
  58.               True if _f_i_l_e exists and is executable.
  59.        --OO _f_i_l_e
  60.               True  if  _f_i_l_e exists and is owned by the effective
  61.  
  62.  
  63.  
  64. FSF                    GNU Shell Utilities                      1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TEST(1L)                                                 TEST(1L)
  71.  
  72.  
  73.               user id.
  74.        --GG _f_i_l_e
  75.               True if _f_i_l_e exists and is owned by  the  effective
  76.               group id.
  77.        _f_i_l_e_1 -nntt _f_i_l_e_2
  78.               True  if  _f_i_l_e_1 is newer (according to modification
  79.               date) than _f_i_l_e_2.
  80.        _f_i_l_e_1 -oott _f_i_l_e_2
  81.               True if _f_i_l_e_1 is older than file2.
  82.        _f_i_l_e_1 --eeff _f_i_l_e_2
  83.               True if _f_i_l_e_1 and _f_i_l_e_2 have the  same  device  and
  84.               inode numbers.
  85.        --zz _s_t_r_i_n_g
  86.               True if the length of _s_t_r_i_n_g is zero.
  87.        --nn _s_t_r_i_n_g
  88.        _s_t_r_i_n_g True if the length of _s_t_r_i_n_g is non-zero.
  89.        _s_t_r_i_n_g_1 == _s_t_r_i_n_g_2
  90.               True if the strings are equal.
  91.        _s_t_r_i_n_g_1 !!== _s_t_r_i_n_g_2
  92.               True if the strings are not equal.
  93.        !! _e_x_p_r True if _e_x_p_r is false.
  94.        _e_x_p_r_1 -aa _e_x_p_r_2
  95.               True if both _e_x_p_r_1 and _e_x_p_r_2 are true.
  96.        _e_x_p_r_1 -oo _e_x_p_r_2
  97.               True if either _e_x_p_r_1 or _e_x_p_r_2 is true.
  98.        _a_r_g_1 OOPP _a_r_g_2
  99.               OOPP  is  one  of  --eeqq,  --nnee,  --lltt, --llee, --ggtt, or --ggee.
  100.               These arithmetic binary operators  return  true  if
  101.               _a_r_g_1  is equal, not-equal, less-than, less-than-or-
  102.               equal, greater-than, or greater-than-or-equal  than
  103.               _a_r_g_2,  respectively.  _a_r_g_1 and _a_r_g_2 may be positive
  104.               integers, negative integers, or the special expres-
  105.               sion  --ll  _s_t_r_i_n_g,  which evaluates to the length of
  106.               _s_t_r_i_n_g.
  107.    OOPPTTIIOONNSS
  108.        When GNU tteesstt is invoked with exactly  one  argument,  the
  109.        following options are recognized:
  110.        _-_-_h_e_l_p Print  a  usage message on standard output and exit
  111.               successfully.
  112.        _-_-_v_e_r_s_i_o_n
  113.               Print version information on standard  output  then
  114.               exit successfully.
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130. FSF                    GNU Shell Utilities                      2
  131.  
  132.  
  133.